<?php
	class HomesController extends AppController{
		public $components = array('RequestHandler');
		public $name = "Homes"; 
		public $helpers = array('Html','GoogleMapV3');
		
		function index(){
			//$clientIP = $this->RequestHandler->getClientIp();
			//$clientIP = "8.8.8.8";
			//debug($_SERVER['REMOTE_ADDR']);
			//debug($_SERVER['HTTP_HOST']);
			//debug($this->RequestHandler);
			
			$clientIP = "1.5.0.65";
			$arrayObject =  @unserialize(file_get_contents("http://ip-api.com/php/".$clientIP));
			debug($arrayObject);	
			if($arrayObject['status'] == 'success'){
				if($arrayObject['countryCode'] == 'AU'){
					//do something
				}
			}else{
				//DO SOMETHING
			}
			//---------------------------------------------
			
		}
		function map(){
			 //$this->helpers[] = 'GoogleMapV3';
		}
	}
?>